UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VnDgC+x+dS0dtNSnsJiGCS2nOD7PeKJALMEsxdRoONY='
WHERE
key_id = 'c553c17d81bf4233c1cc0b8a48b4a79cc57ce7378f1f9538386ef410ccef395a'
AND (
token = 'VnDgC+x+dS0dtNSnsJiGCS2nOD7PeKJALMEsxdRoONY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)