UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jEtclVOYEOCw31pYoIIMlWJ7Rn7WVgVJsb8oElk/cdo='
WHERE
key_id = 'cba1d1fba9846b6cdb25ec27467dc4b1dd9d500d2820c9e66266e58fe1a8f5ac'
AND (
token = 'jEtclVOYEOCw31pYoIIMlWJ7Rn7WVgVJsb8oElk/cdo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)