UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VL1pMtg+uwOeu6VPx+UyVgz9uSwUBKgWcnKSfo+Wzhs=' 
WHERE 
  key_id = '9e6d167fc27a8df9dfe48567877ecb9fc8f20ad344ac99814682e50f78f274e4' 
  AND (
    token = 'VL1pMtg+uwOeu6VPx+UyVgz9uSwUBKgWcnKSfo+Wzhs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035