UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ugsvvgJWkAG5VrzCnidyEdmBg8K7vo6yWLZfOCXPsdQ='
WHERE
key_id = '950413524c0e389b90015cedee6a9d68bc4f2cb0a1011ee0b254bdad012ecb33'
AND (
token = 'ugsvvgJWkAG5VrzCnidyEdmBg8K7vo6yWLZfOCXPsdQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)