UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4GPIKYEtcv4j4xyJWRmxPIHfpjPZnkwydw6nb3PVm/M='
WHERE
key_id = 'a67b6a044c08af64acff34d8651bbe3371d9486ba80c47d347fee09c77fdd785'
AND (
token = '4GPIKYEtcv4j4xyJWRmxPIHfpjPZnkwydw6nb3PVm/M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)