UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hTGco/0mGjvRo78THOJuJLjfawPxICR++1pFWCyU6vU='
WHERE
key_id = '6f5a9c7a691ae2361c289bf88e62cb79864247fa978c602e33b1d7ce7395aa37'
AND (
token = 'hTGco/0mGjvRo78THOJuJLjfawPxICR++1pFWCyU6vU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)