UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mt2GxloOu3EHxwmjHGd4HKiI//gK7fUCWbL9Ni9pvSc=' 
WHERE 
  key_id = 'ca8f156af02f28741afa2bc073357cd2c718bc733e98f54075906823e5cc756a' 
  AND (
    token = 'mt2GxloOu3EHxwmjHGd4HKiI//gK7fUCWbL9Ni9pvSc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017