UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'hRP52YahHrkJkHDnJGpfrA1O4jlHf7Rd3nZ94wvsFzQ=' 
WHERE 
  key_id = '1157856612cb2166d6b08627b35f5eb158ff7f42ec6e048e4289f2587bb18bc8' 
  AND (
    token = 'hRP52YahHrkJkHDnJGpfrA1O4jlHf7Rd3nZ94wvsFzQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022