UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'XEmWDK/SVyGiaqyy7ZgV8DUIqNrdHJenfJFaf9LcTog='
WHERE
key_id = 'ff6e5eded375b4ccf1e3dd14a3dab7143bf1e9190b4da8a6e2d84d3fe0765fd5'
AND (
token = 'XEmWDK/SVyGiaqyy7ZgV8DUIqNrdHJenfJFaf9LcTog='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)