UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pODooDF5mylPTjpqrdkUzmf5yqufsK0omEi1mdq404I='
WHERE
key_id = '8a80e1a0e56229030389653d2e096b65f0b06b0786b46df2e1cf0984ee271ea7'
AND (
token = 'pODooDF5mylPTjpqrdkUzmf5yqufsK0omEi1mdq404I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)