UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CTJKI1Wsyu90OIcfnZywy/85BGbOS9OzM9IcZbiI8iQ='
WHERE
key_id = 'a96553a090f9d0e847f47e9a18d97877a4768d3f0b75ec11531eb252408b5db2'
AND (
token = 'CTJKI1Wsyu90OIcfnZywy/85BGbOS9OzM9IcZbiI8iQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)