UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+3A46YSUgi7EqtayCXr51NWFpUKt/FowBzobgAFVcIM=' 
WHERE 
  key_id = '5c6185464e2c1bfcd798d2896b6461ad246e8d7fdcd957624bda1b6360c2a312' 
  AND (
    token = '+3A46YSUgi7EqtayCXr51NWFpUKt/FowBzobgAFVcIM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035