UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VVquCVOBcW+hPLMh0lQhmpfChxLSvmvaNBy8gorSGjE=' 
WHERE 
  key_id = '4a3ed146443e265ed8808723f4610843edc6ee784a0b88bfe47eb8850a116c71' 
  AND (
    token = 'VVquCVOBcW+hPLMh0lQhmpfChxLSvmvaNBy8gorSGjE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021