UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'SNULd16Tbu5v15hHbZVrHIkw0c1gcAzecDYqipvRpjE=' 
WHERE 
  key_id = '992eb0a26583b53ca9bba343ab7e2ea47cb1e81f2fe283d24b21eb806d31822b' 
  AND (
    token = 'SNULd16Tbu5v15hHbZVrHIkw0c1gcAzecDYqipvRpjE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040