UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IzVLjbbxQrgwTw3OpIAn42ewfhA5KT2YNCAEAszugn8='
WHERE
key_id = '0ec281309c7e32a24125c046fa86070a33f54a1f1ba3fa5f3fe37ef9b5e5c635'
AND (
token = 'IzVLjbbxQrgwTw3OpIAn42ewfhA5KT2YNCAEAszugn8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)