UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EwwFpdmyHsCwu6sVTunmA/GqRXtgGJ+j+J4q8IrsMJM='
WHERE
key_id = 'c11a04a7b785880032a111d4957eed8d252b54aca18629fcb42d53838468b2cb'
AND (
token = 'EwwFpdmyHsCwu6sVTunmA/GqRXtgGJ+j+J4q8IrsMJM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)