UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'q7r8McgTvWtR6nkumUixTM0Atere29/hGQCi5hnNjdw=' 
WHERE 
  key_id = '91a3ea0584a0d553c1d7a04dced292ab18469398e05b38d6217f392d09df92ce' 
  AND (
    token = 'q7r8McgTvWtR6nkumUixTM0Atere29/hGQCi5hnNjdw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047