UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/dLMzOHfUJm/ugLORvGhVi2YYwO9jDmK3ILTv/aLDfk='
WHERE
key_id = '4189cefc57a902b36267df0f9ac3302258428d9cd1caa5b6338b543da99ee724'
AND (
token = '/dLMzOHfUJm/ugLORvGhVi2YYwO9jDmK3ILTv/aLDfk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)