UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'f7Px6mtgBpUOucIxf1XJTXvyN9HdoNiIK7psBvtKN20=' 
WHERE 
  key_id = '6516b1a23da7ded104aab38fd3c893cc24cd47f2795a68c7a04eb3e42fe854f2' 
  AND (
    token = 'f7Px6mtgBpUOucIxf1XJTXvyN9HdoNiIK7psBvtKN20=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019