UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'eZnnGiSSPsBLeMziocBtedkRRWSApERROWtoH08misY=' 
WHERE 
  key_id = '4cf1ce992ce658dcbd74621cee4acf03b7bd3bdb58c4c49dd7377d5beb5edb79' 
  AND (
    token = 'eZnnGiSSPsBLeMziocBtedkRRWSApERROWtoH08misY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016