UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Uzl4LBnP2TqNcd1rXUzRg3ZZxMOwwNnezWRpmFq2skU='
WHERE
key_id = '0945c693abd1e5910098503a9438bd4d40b27a4a18287daf0e53a83630ee2c2a'
AND (
token = 'Uzl4LBnP2TqNcd1rXUzRg3ZZxMOwwNnezWRpmFq2skU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)