UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'AcCOFUZZtIr8adHcwT+DycF4nzJ6lmeoJDhLS/J9Sw8='
WHERE
key_id = 'e13cd998867a44d6d19500c15b7e7fe7418d7910ffe759d98cd3a217cec98c6c'
AND (
token = 'AcCOFUZZtIr8adHcwT+DycF4nzJ6lmeoJDhLS/J9Sw8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)