UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kQ/aGsTwoxuoVZWphRVTjXdjHchssbP2ocj2S8bAlG4='
WHERE
key_id = '28a370d656a63c4a9285e40c0072d8070df8c4f9cf862c9fa5821b652595fb07'
AND (
token = 'kQ/aGsTwoxuoVZWphRVTjXdjHchssbP2ocj2S8bAlG4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)