UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'l8760V32x/c7Nb2dt074xuJzs6kZ1sP58nkKG12kwe8='
WHERE
key_id = '74ef7c9aff3d4852e02f5ed34eecbb4a10c4132643245ec71e42d1b8edcd04f5'
AND (
token = 'l8760V32x/c7Nb2dt074xuJzs6kZ1sP58nkKG12kwe8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)