UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ycF7Yk4wDqOUzFIMkhFqPSJLW0zM9Y4//3E+sHKLnw4='
WHERE
key_id = 'b519b3ce53b433427ed7c264da5c65da2c2ce0230524529667d7cbfdba7a7f16'
AND (
token = 'ycF7Yk4wDqOUzFIMkhFqPSJLW0zM9Y4//3E+sHKLnw4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)