UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'S5C5nSSdHRDMtUntAq9QI0EaJpAeqRbxy6FJQLmU7iQ='
WHERE
key_id = '99edb080c508ffb74c5504cdcedec63903bcc7d4a1d72a0fa4b1580f0bcda388'
AND (
token = 'S5C5nSSdHRDMtUntAq9QI0EaJpAeqRbxy6FJQLmU7iQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)