UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UTE07uhtwD5UcbPu7uXVXi6+eIXGHAUf1/fUeBHNnNw='
WHERE
key_id = 'b024800e3caf88aaa54d6833984c933fb1d993de8da9d3789c0b1fa393d71077'
AND (
token = 'UTE07uhtwD5UcbPu7uXVXi6+eIXGHAUf1/fUeBHNnNw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)