UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ReXiPWSeQ6Pmr1qvAv6lw5xgcLD8OQx9CDiCPUzGXX0='
WHERE
key_id = '864fac9547092ef310e2591a9ac0e72489eca59cab7a4574467bff8027da36a8'
AND (
token = 'ReXiPWSeQ6Pmr1qvAv6lw5xgcLD8OQx9CDiCPUzGXX0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)