UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'owWA3Opb5EmKDdpUu6ijDYiss6JVtCCT5LoWg7dA514=' 
WHERE 
  key_id = '6340dc050c9798cefc2206d0e79209f9c2def605222e65cba75f55b772af120f' 
  AND (
    token = 'owWA3Opb5EmKDdpUu6ijDYiss6JVtCCT5LoWg7dA514=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036