UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'AZJfffZ02x0i47voI4v1n8tH3oAg6nxWPD35AEDEW9M='
WHERE
key_id = 'f96c7a3ab5d9bd4d6dcc27427d03bd64149ee45905dda779be29722375cafe5d'
AND (
token = 'AZJfffZ02x0i47voI4v1n8tH3oAg6nxWPD35AEDEW9M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)