UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EgKEoO7lUtz7hIR1SWfMsA+Q0gVwJj22LsgmcuVk128='
WHERE
key_id = '516ebe76595f9ae5a69c4f82b6c5dd89b978af3b1f128b12ace6a39cf95c822e'
AND (
token = 'EgKEoO7lUtz7hIR1SWfMsA+Q0gVwJj22LsgmcuVk128='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)