UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FC2IaVvCd5NOf1vh5JzsY/YQfr7CbH/jzOzsoZyaG4Q='
WHERE
key_id = 'd14baf3b9de8b29dfadc46ade8346d5a8c86c848a14d53af47b84b159ec6ed1d'
AND (
token = 'FC2IaVvCd5NOf1vh5JzsY/YQfr7CbH/jzOzsoZyaG4Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)