UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9AOgTb1oHodLx/l9HeXCSqZMSMVK8zpRmNInOCGEkT0=' 
WHERE 
  key_id = '9f84e38834bfbced3a6a32db0b1290520258163cc3498c1e99cb9f3a45b4807e' 
  AND (
    token = '9AOgTb1oHodLx/l9HeXCSqZMSMVK8zpRmNInOCGEkT0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028