UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jUtBCekldBr/VMp0J4mtYpfwvqFFCZXyUOlfjf3pwFI='
WHERE
key_id = '2f91d88aff406b6103b62b455be10f5a904f92c815b7083220e975eb23e7a1a9'
AND (
token = 'jUtBCekldBr/VMp0J4mtYpfwvqFFCZXyUOlfjf3pwFI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)