UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zd/7NUFaFvlM7KQufABcorS3US4Tm92K27MeHVfdX4U='
WHERE
key_id = 'a0cae61fc8da5153a668ab26604ede89d64a08fff926eae22d6ffe38dbbf611a'
AND (
token = 'zd/7NUFaFvlM7KQufABcorS3US4Tm92K27MeHVfdX4U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)