UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'i83rtGDOgCXJAP5PXsqbencWBaKQzk2+Ja3+++OP/I4=' 
WHERE 
  key_id = '94ff93a2fc8b6b56ba5e990201a2223a1e70a25b7bab1e14addebf992b3ef855' 
  AND (
    token = 'i83rtGDOgCXJAP5PXsqbencWBaKQzk2+Ja3+++OP/I4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00053