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