UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ogCSKi/Eod6Gnrut/1GtI1yhSusaHtzsq6rEioMd2XI=' 
WHERE 
  key_id = '8319c4675b2a4a202adaa0b84aa940a45818b4037e6857f29f3cbb9fe561c84b' 
  AND (
    token = 'ogCSKi/Eod6Gnrut/1GtI1yhSusaHtzsq6rEioMd2XI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017