UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0yLZQABnkTPXKVJeGsbblEuQ4r6zyXpHCrvLgxlahmc=' 
WHERE 
  key_id = 'e32bfa4a9a7b1f2d18a589680597662285ff375a03ff5f4152c5908260110815' 
  AND (
    token = '0yLZQABnkTPXKVJeGsbblEuQ4r6zyXpHCrvLgxlahmc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034