UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2dnjiz9wnEUj3+8oXo+NAyICVf0+Z2V/0ZM52pp9IPI='
WHERE
key_id = '6fc5987f1848b4a868f2d7a6c07a341506ef97ea636cd9daf3cffe27bd75cc72'
AND (
token = '2dnjiz9wnEUj3+8oXo+NAyICVf0+Z2V/0ZM52pp9IPI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)