UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'E+VY6BwWqwsOrc1wohxkkOjDgTtHp+z/1taHsR3csRs=' 
WHERE 
  key_id = '98b4e77ac214ea2eb291273c6aa700df44645c3f70729bdd717e3a2475c1f6b3' 
  AND (
    token = 'E+VY6BwWqwsOrc1wohxkkOjDgTtHp+z/1taHsR3csRs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026