UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yt7/RsI4VPAU2Ee1jC6wXvlcjij0ZyrcdPaHeiUy1Rw='
WHERE
key_id = 'a8903b090947995b7cd93ce52d8e93aefd1efe1fa8f724cacba2e06b8bade3bb'
AND (
token = 'yt7/RsI4VPAU2Ee1jC6wXvlcjij0ZyrcdPaHeiUy1Rw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)