UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'oklAuPJizDS+tcYdnb8dkWStZv4pc05Iz49vYNDBf6Y=' 
WHERE 
  key_id = 'c8eb74f57f196ececcc9a5c47190f961be360f902f3738f4e406d93bbdd2ddcd' 
  AND (
    token = 'oklAuPJizDS+tcYdnb8dkWStZv4pc05Iz49vYNDBf6Y=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00108